﻿@model IEnumerable<LyyCMS.Core.Models.User>

@{
    ViewData["Title"] = "Index";
}

    <div style="margin:0px 10px; padding:20px 0">
        <a asp-action="Create">
            <i class="fas fa-pencil-alt">
            </i>新建
        </a>

    </div>
<div class="card">
    <div class="card-header">
        <h3 class="card-title">用户</h3>

        <div class="card-tools">
            <button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
                <i class="fas fa-minus"></i>
            </button>
            @*<button type="button" class="btn btn-tool" data-card-widget="remove" data-toggle="tooltip" title="Remove">
                <i class="fas fa-times"></i>
            </button>*@
        </div>
    </div>
    <div class="card-body p-0">
        <table class="table table-striped projects">
            <thead>
                <tr>
                    <th style="width: 1%">
                        #
                    </th>
                    <th style="width: 20%">
                        @Html.DisplayNameFor(model => model.UserName)
                    </th>
                    <th style="width: 30%">
                        @Html.DisplayNameFor(model => model.Email)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.QQ)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.UserType)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.UserState)
                    </th>
                    <th style="width: 20%">
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            #
                        </td>
                        <td>
                            <a>
                                @Html.DisplayFor(modelItem => item.UserName)
                            </a>
                            <br>
                            <small>
                                Created  @Html.DisplayFor(modelItem => item.Crete_At)
                            </small>
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Email)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.QQ)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.UserType)
                        </td>
                        <td class="project-state">
                            @if (item.UserState == LyyCMS.Core.Models.UserState.Active)
                            {
                                <span class="badge badge-success">
                                    @Html.DisplayFor(modelItem => item.UserState)
                                </span>
                            }
                            else if (item.UserState==LyyCMS.Core.Models.UserState.WaittingAuth)
                            {
                                <span class="badge badge-info">
                                    @Html.DisplayFor(modelItem => item.UserState)
                                </span>
                            }
                            else
                            {
                                <span class="badge badge-danger">
                                    @Html.DisplayFor(modelItem => item.UserState)
                                </span>
                            }

                        </td>
                        <td class="project-actions text-right">
                            <a class="btn btn-primary btn-sm" asp-action="Details" asp-route-id="@item.Id">
                                <i class="fas fa-folder">
                                </i>
                                看
                            </a>
                            <a class="btn btn-info btn-sm" asp-action="Edit" asp-route-id="@item.Id">
                                <i class="fas fa-pencil-alt">
                                </i>
                                改
                            </a>
                            <a class="btn btn-danger btn-sm" asp-action="Delete" asp-route-id="@item.Id">
                                <i class="fas fa-trash">
                                </i>
                                删
                            </a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <!-- /.card-body -->
</div>
